Home > biomechZoo > Toolbox > Support Functions > xlswrite1.m

xlswrite1

PURPOSE ^

In order to use it, one must place the following code within the program, as given by Matt Swartz. It opens/closes the activex server, load an add-in if any (by default when Excel opens as a COM server it does NOT load add-ins), and checks to see if the file already exists:

SYNOPSIS ^

function xlswrite1(file,data,sheet,range)

DESCRIPTION ^

 In order to use it, one must place the following code within the program, as given by Matt Swartz. It opens/closes the activex server, load an add-in if any (by default when Excel opens as a COM server it does NOT load add-ins), and checks to see if the file already exists:
 
 Excel = actxserver ('Excel.Application');
 Excel.Workbooks.Open('C:\YourAddInFolder\AddInNameWithExtension');
 Excel.Workbooks.Item('AddInNameWithExtension').RunAutoMacros(1);
 File='C:\YourFileFolder\FileName';
 if ~exist(File,'file')
     ExcelWorkbook = Excel.Workbooks.Add;
     ExcelWorkbook.SaveAs(File,1);
     ExcelWorkbook.Close(false);
 end
 Excel.Workbooks.Open(File);
  
 Run the xlsread1.m as many times as needed. Then run the following code to close the activex server:
 
 Excel.ActiveWorkbook.Save;
 Excel.Quit
 Excel.delete
 clear Excel

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 10-Mar-2024 22:39:06 by m2html © 2005